package com.oem.fragment.service;


import com.oem.fragment.model.Result;
import com.oem.fragment.model.file.MediaFile;
import com.oem.fragment.model.file.PageResult;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

public interface FileService {
    @Multipart
    @POST("/file/product/upload")
    Call<Result> uploadFileByURL(
            @Part("obj") RequestBody obj,
            @Part("uploadFileParamsDto") RequestBody uploadFileParamsDto
    );

    @Multipart
    @POST("/file/product/upload")
    Call<Result> uploadFileByGallery(
            @Part MultipartBody.Part filePart,
            @Part("uploadFileParamsDto") RequestBody paramsRequestBody
    );

    @GET("/file/database/page")
    Call<PageResult<MediaFile>> getMediaFiles(
            @Query("current") int current,
            @Query("size") int size
    );
}

